import React from 'react'
import { Form, Button, Row, Col, DatePicker, Input, Cascader, Switch, Icon } from 'antd'


class Filter extends React.Component{
	constructor(props){
		super(props)
		this.state = {
			searchName:'',
		}
	}
  	nameChange=(e)=>{
  		this.setState({searchName:e.target.value})
  	}
  	searchLeave=()=>{
  		const { onSearch } = this.props
  		onSearch(this.state.searchName)
  	}	
	render(){
		const { onAdd } = this.props 
		  return (
		  	<div>
		  		<h3 style={{fontWeight:600,marginBottom:10}}>人员管理列表</h3>
			    <Row gutter={24}>
					<Col lg={6} md={3} sm={4} xs={6} style={{ marginBottom: 16 }}>
			            <span>人员姓名:&nbsp;&nbsp;</span>
			            <Input
			              placeholder="请输入人员姓名进行搜索"
			              onChange={this.nameChange}
			              style={{ width: 200 }}
			            />
			         </Col>
			         <Col lg={6} md={3} sm={4} xs={6} push={1} style={{marginBotton: 16 }}>
				         <Button
				              style={{ marginLeft: 10,width:200,height:30 }}
				              type="primary"
				              size="default"
				              onClick={this.searchLeave}
				            >
				              查询
			    			 </Button>
					</Col>
			      <Col xl={{ span: 24 }} md={{ span: 24 }} sm={{ span: 24 }}>
			        <Button type="dashed" style={{width:"100%",margin:"20px 0",height:40}} onClick={onAdd}>
			        		<Icon type="plus" />新增
			      	</Button>
			      </Col>
			    </Row>
		    </div>
		  )
	}
}


export default Filter
